﻿var Frame = {
    Str: {
        // 验证是否是手机号码
        isMobile: function (str) {
            var regExp = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
            return regExp.test(str);
        },
        // 验证Email
        isEmail: function (str) {
            var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z-_]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2,9}|net|NET|asia|ASIA|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT|cn|CN|cc|CC|kr|KR|hr|HR|eu|EU|tw|TW|hk|HK|la|LA)$"
            var re = new RegExp(regu);

            if (str.search(re) == -1) {
                return false;   //非法
            }

            return true; //正确
        }, //  判断是否为空
        isNull: function (str) {
            var isTure;

            if (str == undefined || str == null) {
                isTure = true;
            } else {
                if ($.trim(str) == "") {
                    isTure = true;
                } else {
                    isTure = false;
                }
            }

            return isTure;
        },
        
    }
}

function isEmpty(obj) {
    if (typeof obj == "undefined" || obj == null || obj == "") {
        return true;
    } else {
        return false;
    }
}